import Vue from 'vue'
import Router from 'vue-router'
import Layout from '../components/Layout.vue'
import Index from '@/components/index'
import Orderlist from '@/components/orderlist'
import Ordercenter from '@/components/ordercenter'
import Managerlist from '@/components/managerlist'
import Managercreate from '@/components/managercreate'
Vue.use(Router);
var AsyncRoutes = [
  {path: '/login', name: 'Login', hidden: true, component:()=>import('@/components/Login.vue')},
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    redirect: '/home',
    children: [{
      path: '/home',
      name: 'Home',
      component: () => import('../components/Home.vue'),
      meta: {
        title: '首页',
        icon: 'vue-dsn-icon-zhuye',
        fixed: true
      }
    }]
  },
  {
    path: '/chat',
    name: '聊天公告',
    component: Layout,
    redirect: '/chatmassage',
    children: [{
      path: '/chatmassage',
      name: 'chatmassage',
      component: () => import('@/components/Chat.vue'),
      meta: {
        title: '聊天公告'
      }
    }],
  }
]

const route=new Router({
  mode:'history',
  routes: AsyncRoutes
})

// route.beforeEach((to,from,next)=>{
//   console.log(1131546)
// })
export default route
